<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>产品列表</title> 
    <link rel="shortcut icon" href="favicon.ico"> 
    <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.0.0" rel="stylesheet">
    <link href="/public/static/admin/js/plugins/layer/skin/layer.css" rel="stylesheet">
    <base target="_blank">
    <!-- 全局js -->
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="/public/static/admin/js/plugins/layer/layer.min.js"></script>

    <!-- 自定义js -->
    <script src="/public/static/admin/js/content.js?v=1.0.0"></script>
    <script src="/public/static/admin/js/contabs.js"></script>
    <script src="/public/static/admin/js/common.js"></script>
    <script src="/public/static/admin/js/article.js"></script>
    <script src="/public/static/admin/js/myAjax.js"></script>

    <!-- Bootstrap table -->
    <script src="/public/static/admin/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/public/static/admin/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
    <script src="/public/static/admin/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>  

</head>
<div class="wrapper">

  <!-- Main content -->
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i> 产品属性</h3>
        </div>
        <div class="panel-body">
          <div class="navbar navbar-default">
              <form action="" id="search-form2" class="navbar-form form-inline" method="post" onsubmit="return false">
                <div class="form-group">
                  <select name="kind_id" id="kind_id" class="form-control">
                    	<option value="">所有分类</option>
                        <?php echo $cat_select; ?>
                   </select>
                </div>                  
                <div class="form-group">                 
	                <button type="submit" onclick="ajax_get_table('search-form2',1)" id="button-filter" class="btn btn-primary pull-right">
	                 <i class="fa fa-search"></i> 筛选
	                </button>
                </div>
                <button type="button" onclick="location.href='{:url('Admin/product/addEditProductAttribute')}'" class="btn btn-primary pull-right">
                 <i class="fa fa-plus"></i> 添加属性
                </button>
              </form>
          </div>
          <div id="ajax_return"> </div>
        </div>
      </div>
    </div>
    <!-- /.row --> 
  </section>
  <!-- /.content --> 
</div>
<!-- /.content-wrapper --> 
<script>
    $(document).ready(function(){		
		<?php
		    if(input('get.type_id'))
			{
			   echo "$('#type_id').val(".input('get.type_id').");"; 
			}
		?>
			$('#button-filter').trigger('click');
    });

    // ajax 抓取页面 form 为表单id  page 为当前第几页
    function ajax_get_table(form,page){
		cur_page = page; //当前页面 保存为全局变量
        $.ajax({
            type : "POST",
            url:"/index.php/Admin/product/ajaxProductAttributeList/p/"+page,//+tab,
            data : $('#'+form).serialize(),// 你的formid
            success: function(data){
                $("#ajax_return").html('');
                $("#ajax_return").append(data);
            }
        });
    }

</script> 
</body>
</html>